/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package DadosBD;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author Rodrigo L. Benites
 */
@Embeddable
public class PrereqPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "DISCIPLINA")
    private String disciplina;
    @Basic(optional = false)
    @Column(name = "PREREQ")
    private String prereq;

    public PrereqPK() {
    }

    public PrereqPK(String disciplina, String prereq) {
        this.disciplina = disciplina;
        this.prereq = prereq;
    }

    public String getDisciplina() {
        return disciplina;
    }

    public void setDisciplina(String disciplina) {
        this.disciplina = disciplina;
    }

    public String getPrereq() {
        return prereq;
    }

    public void setPrereq(String prereq) {
        this.prereq = prereq;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (disciplina != null ? disciplina.hashCode() : 0);
        hash += (prereq != null ? prereq.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PrereqPK)) {
            return false;
        }
        PrereqPK other = (PrereqPK) object;
        if ((this.disciplina == null && other.disciplina != null) || (this.disciplina != null && !this.disciplina.equals(other.disciplina))) {
            return false;
        }
        if ((this.prereq == null && other.prereq != null) || (this.prereq != null && !this.prereq.equals(other.prereq))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "DadosBD.PrereqPK[ disciplina=" + disciplina + ", prereq=" + prereq + " ]";
    }
    
}
